﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace _01_自定义属性
{
    class Program
    {
        static void Main(string[] args)
        {
            DeveloperAttribute MyAttribute = (DeveloperAttribute)Attribute.GetCustomAttribute(typeof(Developer), typeof(DeveloperAttribute));

            Console.WriteLine(MyAttribute.Name+MyAttribute.Company+MyAttribute.CreateTime);
            Console.ReadKey();
        }
        
    }


    [DeveloperAttribute("Getlayer","Map","12点")]
    public class Developer
    {
        public string Name { get; set; }
        public string Company { get; set; }
        public string CreateTime { get; set; }
    }

    [AttributeUsage(AttributeTargets.All)]
    class DeveloperAttribute : Attribute
    {
        private string  name;
        private string company;
        private string createTime;
        public DeveloperAttribute(string name,string company,string createtime)
        {
            this.name = name;
            this.company = company;
            this.createTime = createtime;
        }
        public string  Name
        {
            get { return name; }  
        }

        public string Company
        {
            get { return company; } 
        }
       
        public string CreateTime
        {
            get { return createTime; }
        }
        
    }
}
